<xsl:stylesheet version="1.0" 
  xmlns:date="http://exslt.org/dates-and-times"
  xmlns:ebe="http://cks/ebemethods"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:ms="urn:schemas-microsoft-com:xslt"
  xmlns:dt="urn:schemas-microsoft-com:datatypes"
  exclude-result-prefixes="date ebe">

<xsl:output omit-xml-declaration="yes" />

<xsl:param name="IsBlogOwner" />
<xsl:param name="RelativeUrl" />
<xsl:param name="Language" />
<xsl:param name="ShortDatePattern" />

<xsl:template match="/">
		<h2><xsl:value-of select="ebe:res('Trackbacks')"/></h2>
  <br/>
		<xsl:apply-templates select="rows/row"/>
</xsl:template>

<xsl:template match="row">
	
	<div><xsl:attribute name="class"><xsl:choose><xsl:when test="position() mod 2 = 0">comments-author</xsl:when><xsl:otherwise>comments-visitor</xsl:otherwise></xsl:choose></xsl:attribute>
		<xsl:variable name="publishedDate" select="date:parseDate(Created, 'yyyy-MM-dd')"/>
		<xsl:choose>
			<xsl:when test="LinkbackType = 'Pingback'">
				<span class="linkbacktext">
				<xsl:value-of select="substring-after(PostName,', ')"/><br/>
					<xsl:value-of select="PostExcerpt" disable-output-escaping="yes" />
					<br/>
          <xsl:value-of select="ebe:res('PingbackFrom')"/>
						<a href="{substring-before(PostName,',')}"><xsl:value-of select="BlogName"/></a>
          <xsl:value-of select="ebe:res('PingbackOn')"/> <xsl:value-of select="ms:format-time($publishedDate, $ShortDatePattern, $Language)"/>
				</span>			
			</xsl:when>

			<xsl:otherwise>
				<span class="linkbacktitle">
					<xsl:value-of select="substring-after(PostName,', ')"/>		
				</span>
				<span class="linkbacktext">
					<br/><xsl:value-of select="PostExcerpt" disable-output-escaping="yes" /><br/>
          <xsl:value-of select="ebe:res('TrackbackFrom')"/> 
						<a href="{substring-before(PostName,',')}"><xsl:value-of select="BlogName"/></a>
          <xsl:value-of select="ebe:res('TrackbackOn')"/> <xsl:value-of select="ms:format-time($publishedDate, $ShortDatePattern, $Language)"/>
				</span>					
			</xsl:otherwise>
		</xsl:choose>
		<hr class="commentSep" />
	</div>
</xsl:template>
 
</xsl:stylesheet>
